import { get, post } from '@/utils/request'

export default class OnlineOperation {
  static listDict(params) {
    return post(`/service-workflow/b/form/onlineOperation/v1/listDict`, params)
  }

  static listByDatasourceId(params) {
    return post(`/service-workflow/b/form/onlineOperation/v1/listByDatasourceId`, params)
  }

  static listByOneToManyRelationId(params) {
    return post(`/service-workflow/b/form/onlineOperation/v1/listByOneToManyRelationId`, params)
  }

  static addDatasource(params) {
    return post(`/service-workflow/b/form/onlineOperation/v1/addDatasource`, params)
  }

  static addOneToManyRelation(params) {
    return post(`/service-workflow/b/form/onlineOperation/v1/addOneToManyRelation`, params)
  }

  static updateDatasource(params) {
    return post(`/service-workflow/b/form/onlineOperation/v1/updateDatasource`, params)
  }

  static updateOneToManyRelation(params) {
    return post(`/service-workflow/b/form/onlineOperation/v1/updateOneToManyRelation`, params)
  }

  static viewByDatasourceId(params) {
    return get(`/service-workflow/b/form/onlineOperation/v1/viewByDatasourceId`, params)
  }

  static viewByOneToManyRelationId(params) {
    return get(`/service-workflow/b/form/onlineOperation/v1/viewByOneToManyRelationId`, params)
  }

  static deleteDatasource(params) {
    return post(`/service-workflow/b/form/onlineOperation/v1/deleteDatasource`, params)
  }

  static deleteOneToManyRelation(params) {
    return post(`/service-workflow/b/form/onlineOperation/v1/deleteOneToManyRelation`, params)
  }
}
